#ifndef LLVM_H
#define LLVM_H

#include "ast_types.h"
#include "tablesymb.h"
#include "tabfun.h"
#include "ll.h"

char new_reg();
char* alloc();

void gen_label(char const* lbl, int depth);
void gen_br(int depth, char const* br);
void gen_cond_br(char const* reg, int depth, char const* br1, char const* br2);

void gen_start_while(char* deep);
void gen_while(char* reg,char* deep);
void gen_end_while(char* deep);

char* gen_numbinop(char op, Type t, Lhs_type* op1, Lhs_type* op2);
char* gen_host(Type t, Lhs_type op1, Lhs_type op2);
char* gen_next_lblstr();
void gen_start_func(Fonction *f, bool variadic);
void gen_fdecl(Type ret, char const* nom, ll_list* params, bool variadic);
void gen_end_func();
void gen_ret(Type, char* val);
char const* trub_to_tllvm(Type t);

#endif
